(function () {
    const titimg = document.querySelector('.titimg');
    const describe = document.querySelector('.describe');
    const detail = document.querySelector('.detail');
    const cid = window.location.search.split('=')[1];

    axios.get('/api/sort', {
        params: { cid }
    }).then(res => {
        let data = res.data.sort[0];
        if (res.data.code === 1) {
            titimg.children[0].src = data.pic;
            describe.innerText = data.describe;
            detail.innerHTML = data.details;
        }
    }).catch(err => {
        console.error(err);

    })
})();